package com.chuanjiabao.wisdom.util.dialog;

import android.content.Context;
import android.databinding.DataBindingUtil;
import android.view.LayoutInflater;
import android.view.View;

import com.chuanjiabao.wisdom.R;
import com.chuanjiabao.wisdom.databinding.DialogSelectSexBinding;
import com.chuanjiabao.wisdom.listener.OnBHClickListener;

public class SelectSexDialog extends BaseDialog {

    Context context;
    DialogSelectSexBinding binding ;
    OnBHClickListener onBHClickListener;

    public SelectSexDialog(Context context) {
        super(context);
        this.context = context;
        binding = DataBindingUtil.inflate(
                LayoutInflater.from(context),
                R.layout.dialog_select_sex,
                null,
                false
        );
        binding.setDialog(this);
        setContentView(binding.getRoot());
    }

    public void setOnBHClickListener(OnBHClickListener onBHClickListener) {
        this.onBHClickListener = onBHClickListener;
    }

    public void noPoint(View view){
        if (onBHClickListener != null) {
            onBHClickListener.onCloseClick();
        }
        binding.ivModuleMan.setImageResource(R.drawable.icon_pay_select_yes);
        binding.ivModuleWoman.setImageResource(R.drawable.icon_pay_select_no);
        dismiss();
    }

    public void okPoint(View view){
        if (onBHClickListener != null) {
            onBHClickListener.onConfirmClick();
        }
        binding.ivModuleWoman.setImageResource(R.drawable.icon_pay_select_yes);
        binding.ivModuleMan.setImageResource(R.drawable.icon_pay_select_no);
        dismiss();
    }

}

